#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   file.py    
@Contact :   raogx.vip@hotmail.com
@License :   (C)Copyright 2017-2018, Liugroup-NLPR-CASIA

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2020/10/18 21:37   gxrao      1.0         None
'''


import os

def GetAllFileNameBySurfix(fileDir, surfix):
    """
    根据文件后缀获取目录下所有文件名
    :param fileDir: 文件目录
    :param surfix: 筛选的文件后缀
    :return:
    """
    fileList = []
    for root, dirs, files in os.walk(fileDir):
        for file in files:
            if os.path.splitext(file)[1] == surfix:
                fileList.append(os.path.splitext(file)[0] + os.path.splitext(file)[1])
    return fileList
